package com.bds.snatch.system.mq;

import java.util.List;

import org.apache.log4j.Logger;
import org.nutz.dao.Dao;
import org.springframework.stereotype.Service;

import com.bds.snatch.model.H2Urls;
import com.bds.snatch.system.queue.TQueue;

@Service
public class RepairLocalMQ {
	private static Logger logger = Logger.getLogger(RepairLocalMQ.class);

	public void doStart(Dao dao) {
		List<H2Urls> list = dao.query(H2Urls.class, null);

		for (H2Urls url : list) {
			url.setType("url");
			TQueue.getQueue().add(url);
		}
		logger.info("加载本地H2缓存队列 " + list.size() + "个完毕");
	}
}
